/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-10-09 16:05:04
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-10-09 16:15:50
 * @FilePath: /logsystem/Proxy mode/proxy.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*房东通过中介将一个房子租借出去理解代理模式*/
#include <iostream>
#include <string>

//租借房子
class RentHouse{
    public:
        virtual void rentHouse() = 0;

};

//房东
class LandLord : public RentHouse{
    public:
        void rentHouse(){
            std::cout << "将房子租出去\n";
        }
};

//中介
class Intermediary : public RentHouse{
    public:
        void rentHouse(){
            std::cout << "发布招租启示\n";
            std::cout << "带人看房\n";
            _LandLord.rentHouse();
            std::cout << "负责租后维修\n";
        }
    private:
        LandLord _LandLord;
};

int main()
{
    Intermediary intermediary;
    intermediary.rentHouse();
    return 0;

}